package zozopo.database;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 数据库管理器:与数据库建立连接、断开连接、执行查询和更新操作
 * 用于本地测试使用
 * @author 林继双
 * @version 1.2
 * 
 */

public class LocalDatabaseManager implements DatabaseManager {

	 /** 
     * 获得一个数据库连接
     * 
     * @return Connection对象
     * 
     */
	
	
	public Connection getConnection(){
		
		
			Connection conn = null;
			
			String driver = "com.mysql.jdbc.Driver";
			String url = "jdbc:mysql://zozopo.gotoftp2.com/zozopo"; 
			String user = "zozopo"; 
			String password = "f95317677"; 
			try {
				Class.forName(driver);
				conn = DriverManager.getConnection(url, user, password);
			} catch (Exception e) {
				e.printStackTrace();
			}
			return conn;
		
	}//*/
	
	

	public ResultSet executeQuery(Connection conn, String sql) {
		// TODO Auto-generated method stub
		return null;
	}

	public boolean executeUpdate(Connection conn, String sql) {
		// TODO Auto-generated method stub
		return false;
	}

	public void releaseConnection(Connection conn) {
		// TODO Auto-generated method stub

	}

}
